//
//  getCodeTableViewCell.m
//  IntelligentHousehold
//
//  Created by wmwMAC on 17/6/23.
//  Copyright © 2017年 Cassie. All rights reserved.
//

#import "getCodeTableViewCell.h"

@implementation getCodeTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.leftTextFiled = [[UITextField alloc] init];
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChange:) name:UITextFieldTextDidChangeNotification object:_leftTextFiled];
        [self.contentView addSubview:_leftTextFiled];
        
        
        self.getCodeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_getCodeBtn setTitle:@"" forState:UIControlStateNormal];
        [self.contentView addSubview:_getCodeBtn];
        
    }
    
    return self;
}
- (void) textChange:(NSNotification *)noti{
    
    
    if (noti.object == self.leftTextFiled) {
        // 执行代理方法
        NSLog(@"isCurrent");
    }
    //    NSLog(@"%@",textFiled);
    NSLog(@"%@",self.leftTextFiled.text);
    
    //    self.nameIdStr = _leftTextFiled.text;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    _leftTextFiled.frame = CGRectMake(10, 10, ContentWEITH-20, ContentHEIGHT-20);
    
}
-(void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
